package com.wswy.wzcx.model

import com.google.gson.annotations.SerializedName
import com.wswy.wzcx.R
import java.io.Serializable

/**
 * Created by wangduheng26 on 2018/4/13.
 * wangduheng26@gmail.com
 *
 * 10;// 刚创建，待支付（未支付）
 * 20;// 支付成功（已支付）
 * 30;// 处理中
 * 40;// 资料补充
 * 50;// 资料审核
 * 60;// 订单失败，待退款
 * 70;// 订单失败，退款中
 * 80;// 订单失败，退款成功
 * 85;// 订单失败，退款失败
 * 90;// 订单处理成功
 * 100;// 订单过期关闭
 */
data class MyOrderMode(@SerializedName("id") val id: String?, @SerializedName("orderNo") val orderNo: String?,
                       @SerializedName("title") val title: String?, @SerializedName("orderType") val orderType: Int,
                       @SerializedName("userId") val userId: String?, @SerializedName("status") var status: Int,
                       @SerializedName("statusName") val statusName: String?, @SerializedName("money") val money: String?,
                       @SerializedName("createTime") val createTime: String?, @SerializedName("updateTime") val updateTime: String?,
                       @SerializedName("isEnd")val isEnd:Boolean):Serializable {
    companion object {
        const val TYPE_JAY_BL = 0//加油卡办理
        const val TYPE_JYK_CZ = 1//加油卡充值
        const val TYPE_FKDJ = 10//罚款代缴
        const val TYPE_WZDB = 20
    }

    fun getIcon(): Int {
        var iconId = -1
        when (orderType) {
            TYPE_JAY_BL -> iconId = R.drawable.icon_yk
            TYPE_JYK_CZ -> iconId = R.drawable.icon_fkdj
            TYPE_FKDJ -> iconId = R.drawable.order_daijiaofadan
            TYPE_WZDB -> iconId = R.drawable.order_weizhangdaijiao
        }
        return iconId
    }


    fun getNeedUpload():Boolean{
        return status==40||status==45
    }
}